﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Profile;
using COFE.Core.Logger;

namespace COFE.Core.Lister
{
    /// <summary>
    /// Manipulate a directory in a filesystem defined by IDirectoryLister.
    /// </summary>
    public interface IDirectoryController
    {
        string ListerKey { get;  }

        /// <summary>
        /// Create a file and return it.
        /// For ArchiveDirectorylister, it will just return a non-exist fileinfo.
        /// </summary>
        IInternalFileInfoExA CreateFile(IInternalDirectoryInfoExA parent, string fileName);

        /// <summary>
        /// Construct a directory and return it.
        /// </summary>
        IInternalDirectoryInfoExA CreateDirectory(IInternalDirectoryInfoExA parent, string dirName);        

        /// <summary>
        /// Rename an entries in same directory.
        /// </summary>
        /// <param name="item"></param>
        /// <param name="newName">New file or directory name.</param>
        void Rename(IInternalFileSystemInfoExA entry, string newName);

        /// <summary>
        /// Add an item to the specified dir.
        /// </summary>
        void Copy(IInternalFileSystemInfoExA entry, IInternalDirectoryInfoExA targetDir, bool raiseAlert);

        /// <summary>
        /// Move an item to the specified dir.
        /// </summary>
        void Move(IInternalFileSystemInfoExA entry, IInternalDirectoryInfoExA targetDir, bool raiseAlert);

        /// <summary>
        /// Remove an item.
        /// </summary>
        void Delete(IInternalFileSystemInfoExA entry, bool raiseAlert);

        /// <summary>
        /// Notify change to it's file system.
        /// </summary>
        void NotifyModified(IInternalFileSystemInfoExA entry, ModifiedAction actionm, string oldParsePath = null);

        /// <summary>
        /// Notify change to it's file system.
        /// </summary>
        void NotifyModified(string fullPath, bool isFolder, ModifiedAction action, string oldParsePath = null);

        ///// <summary>
        ///// Raise this event when file system changed.
        ///// </summary>
        //event EventHandler<FileSystemEventArgsExA> OnFileSystemModified;
    } 
}
